package cn.crm.Service.Impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.crm.Service.IOrderService;
import cn.crm.common.ServerResponse;
import cn.crm.entity.Order;
import cn.crm.mapper.OrderMapper;
@Service
public class OrderServiceImpl implements IOrderService{

	@Autowired
	private OrderMapper ordermapper;

	@Override
	public ServerResponse pageList(Integer page, Integer limit,Order order) {
		// TODO Auto-generated method stub
		PageHelper.startPage(page, limit);
		List list = ordermapper.pageList(order);
		PageInfo pageInfo = new PageInfo<>(list);
		int count = (int) pageInfo.getTotal();
		return ServerResponse.createSuccess("查找成功", count, list);
	} 
	
 
}
